import express from 'express'
import bodyParser from 'body-parser'
import cookieParser from 'cookie-parser'
import { setCloudDiskServerFn } from './CloudServer/CloudDisk.js'
import { setCloudDiskTaskFn } from './CloudTask/index.js'
import sqlAPI from './CloudTask/sqlLite.js'
const app = express()
app.use(cookieParser())
// 使用 body-parser 中间件来解析 JSON 和 URL 编码的数据
app.use(bodyParser.json())
app.use(bodyParser.urlencoded({ extended: true }))
// 设置端口
const port = 4000
setCloudDiskServerFn(app)
setCloudDiskTaskFn(app)

// 启动服务器
app.listen(port, '0.0.0.0', () => {
  console.log(`Server is running on http://localhost:${port}`)
})
